package net.lovesrc.allin.biz.dublecow;

import net.lovesrc.allin.controller.BaseController;
import net.lovesrc.allin.jobs.backup.DoubleCowRegisterJob;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/cows")
public class DoubleCowsController extends BaseController {


    @Autowired
    DoubleCowRegisterJob doubleCowRegisterJob;


    @GetMapping("/register/start")
    public String registerStart() {
        doubleCowRegisterJob.flag.set(true);
        return "ok";
    }

    @GetMapping("/register/stop")
    public String registerStop() {
        doubleCowRegisterJob.flag.set(false);
        return "ok";
    }


}
